<template>
  <div>
    <div class="detail-banner" @click="handelBannerClick">
      <img class="banner-img" :src="bannerImg" alt="">
      <div class="banner-info">
        <div class="banner-title">{{this.sightName}}</div>
        <div class="banner-num">
          <span class="iconfont banner-icon">&#xe65f;</span>
          {{this.imgTotal}}
        </div>
      </div>
    </div>
    <FadeAnimation>
       <CommonGallary
        :imgs='bannerImgs'
        v-show="showGallary"
        @close='handelGallaryClose'
      ></CommonGallary>
    </FadeAnimation>
  </div>
</template>
<script>
import CommonGallary from 'common/gallary/Gallary'
import FadeAnimation from 'common/fade/FadeAnimation'
export default {
  name: 'DetailBanner',
  components: {
    CommonGallary,
    FadeAnimation
  },
  props: {
    sightName: String,
    bannerImg: String,
    bannerImgs: Array
  },
  data () {
    return {
      showGallary: false,
      imgTotal: 2
    }
  },
  methods: {
    handelBannerClick () {
      this.showGallary = true
    },
    handelGallaryClose () {
      this.showGallary = false
    }
  }
}
</script>
<style scoped lang='stylus'>
.detail-banner
  position: relative
  height:0
  overflow: hidden
  padding-bottom: 55%
  .banner-img
    width:100%
  .banner-info
    display:flex
    position:absolute
    left:0
    right:0
    bottom:0
    color:#fff
    line-height:0.6rem
    background-image:linear-gradient(top, rgba(0,0,0,0),rgba(0,0,0,0.8))
    .banner-title
      flex:1
      font-size 0.32rem
      padding:0 0.2rem
    .banner-num
      padding:0 0.4rem
      height: 0.32rem
      line-height:0.32rem
      background:rgba(0,0,0,0.8)
      font-size:0.24rem
      border-radius:0.3rem
      margin-top: 0.14rem;
      .banner-icon
        font-size:0.24rem
</style>
